import 'package:agora_rtc_engine/agora_rtc_engine.dart';
import 'package:flutter/cupertino.dart';
import 'package:gameplay_flutter/m_chatroom/src/template/music/model/room_music_center_controller.dart';

import '../../../../../lib_baseview/lib_baseview.dart';
import '../../../../../lib_baseview/utils/screen_utils.dart';
import '../model/room_music_mine_controller.dart';
import '../widget/play_all_widget.dart';

/// 我的音乐列表
class RoomMusicMinePage extends StatelessWidget {
  final MusicChartInfo info;

  final centerController = Get.find<RoomMusicCenterController>();

  RoomMusicMinePage(this.info, {super.key}) {
    Get.put(RoomMusicMineController());
  }

  @override
  Widget build(BuildContext context) {
    return GetBuilder<RoomMusicMineController>(builder: (logic) {
      if (logic.musicCollection == null) {
        return const Center(child: CupertinoActivityIndicator());
      }
      if (logic.count <= 0) {
        // return Center(child: DFEmptyDataView());
      }
      return Column(
        mainAxisSize: MainAxisSize.max,
        children: [
          PlayAllWidget(count: logic.count, onTap: () => logic.playAll()),
          Text('JxRefresher'),
          // Expanded(
          //   child: JxRefresher(
          //     controller: logic.controller,
          //     onLoading: logic.loadData,
          //     onRefresh: logic.refreshData,
          //     canLoad: logic.canLoadMore,
          //     canRefresh: true,
          //     content: ListView.builder(
          //       itemBuilder: (c, index) {
          //         return Padding(
          //           padding: const EdgeInsets.only(top: 4, bottom: 4),
          //           child: MusicItemWidget(item: logic.musicCollection![index]),
          //         );
          //       },
          //       itemCount: logic.count,
          //     ),
          //   ),
          // ),
          SizedBox(
            height: 130 + ScreenUtils.ins.iphoneXBottom,
          )
        ],
      );
    });
  }
}
